package com.feng.service.impl;

import com.feng.api.vo.UserVo;
import com.feng.service.IUserService;
import com.xiaoleilu.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

/**
 * Description:
 * User: zhangyinglong
 * Date: 2021-04-22
 * Time: 10:28
 */
@Slf4j
@Service
public class UserServiceImpl implements IUserService, ApplicationContextAware {
    @Override
    public void addUser(UserVo userVo) {
        log.info("add user :{}", JSONUtil.toJsonStr(userVo));
    }

    @Override
    public void delUser(Integer uid) {
        log.info("del user :{}",uid);
    }

    @Override
    public UserVo queryUser(Integer uid) {
        return new UserVo("zhangsan",20,1);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        log.info("UserServiceImpl applicationContext is :{}",applicationContext.getClass().getName());
    }
}
